package fire.combat;

import fire.Main;
import fire.room.Map;
import jgame.JGColor;
import jgame.JGObject;
import jgame.JGTimer;
import jgame.platform.JGEngine;

public class EnemyTurn extends JGObject {

	private int step = 0;
	private int frame;
	private CombatPet enemy;

	public EnemyTurn(CombatPet enemy, int playerColId, int frames) {
		super("loading", true, 0, 0, 10001, null);
		this.frame = frames;
		this.enemy = enemy;
		JGTimer a = new JGTimer(frames, true, this) {
			@Override
			public void alarm() {
				CombatMap.getAttackButton().setTurn(true);
				parent_obj.remove();
			}
		};
	}

	@Override
	public void paint(JGEngine g) {
		if (step > frame / 2) {
			enemy.attack(enemy, CombatMap.getPlayerPet());
			step = -10000;
		}
		step++;
	}

}
